#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kprobes.h>

static int handler_pre(struct kprobe *p, struct pt_regs *regs) {
    printk(KERN_INFO "Pre-handler: Function %s called\n", p->symbol_name);
    return 0;
}

static void handler_post(struct kprobe *p, struct pt_regs *regs, unsigned long flags) {
    printk(KERN_INFO "Post-handler: Function %s returned\n", p->symbol_name);
}

static struct kprobe kp = {
    .symbol_name = "smq_reg_get_board_slot",
    .pre_handler = handler_pre,
    .post_handler = handler_post,
};

static int __init kprobe_init(void) {
    register_kprobe(&kp);
    return 0;
}

static void __exit kprobe_exit(void) {
    unregister_kprobe(&kp);
}

module_init(kprobe_init);
module_exit(kprobe_exit);
MODULE_LICENSE("GPL");